package org.dromara.knowledge.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.knowledge.domain.KnowledgeHitLog;

/**
 * 知识库命中日志业务对象 knowledge_hit_log
 *
 * @author ruoyi
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = KnowledgeHitLog.class, reverseConvertGenerate = false)
public class KnowledgeHitLogBo extends BaseEntity {

    /**
     * 主键ID
     */
    @NotNull(message = "主键ID不能为空", groups = {EditGroup.class})
    private Long id;

    /**
     * 会话ID
     */
    @NotBlank(message = "会话ID不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 64, message = "会话ID长度不能超过64个字符")
    private String sessionId;

    /**
     * 知识库ID
     */
    @NotBlank(message = "知识库ID不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 64, message = "知识库ID长度不能超过64个字符")
    private String knowledgeId;

    /**
     * 文档ID
     */
    @Size(max = 64, message = "文档ID长度不能超过64个字符")
    private String docId;

    /**
     * 知识片段ID
     */
    @Size(max = 64, message = "知识片段ID长度不能超过64个字符")
    private String fragmentId;

    /**
     * 查询文本
     */
    @NotBlank(message = "查询文本不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 2000, message = "查询文本长度不能超过2000个字符")
    private String queryText;

    /**
     * 查询向量
     */
    @Size(max = 65535, message = "查询向量长度不能超过65535个字符")
    private String queryVector;

    /**
     * 相似度分数
     */
    @DecimalMin(value = "0.0", message = "相似度分数不能小于0")
    @DecimalMax(value = "1.0", message = "相似度分数不能大于1")
    private Double similarityScore;

    /**
     * 排名
     */
    @Min(value = 1, message = "排名必须大于0")
    private Integer ranking;

    /**
     * 模型名称
     */
    @Size(max = 100, message = "模型名称长度不能超过100个字符")
    private String modelName;

    /**
     * 搜索参数
     */
    @Size(max = 1000, message = "搜索参数长度不能超过1000个字符")
    private String searchParams;

    /**
     * 响应时间（毫秒）
     */
    @Min(value = 0, message = "响应时间不能小于0")
    private Long responseTime;

    /**
     * 命中次数
     */
    @Min(value = 0, message = "命中次数不能小于0")
    private Integer hitCount;

    /**
     * 备注
     */
    @Size(max = 500, message = "备注长度不能超过500个字符")
    private String remark;

}